{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\research\works\주제57_외국인_지방자치\data\STATA_code.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}24 Jul 2025, 11:33:45

{com}. encode district, gen(district_1)

. 
. xtset district_1 year
{res}{txt}{col 8}panel variable:  {res}district_1 (strongly balanced)
{txt}{col 9}time variable:  {res}{col 25}year, 2000 to 2023
{txt}{col 17}delta:  {res}1 unit

{com}. 
. 
. 
. 
. 
. xtreg immigration_mentions birth_rate foreign_ratio population_growth urban_ratio conservative_ratio i.year, fe cl( district )

{txt}Fixed-effects (within) regression               Number of obs      = {res}     5496
{txt}Group variable: {res}district_1                      {txt}Number of groups   = {res}      229

{txt}R-sq:  within  = {res}0.8631                         {txt}Obs per group: min = {res}       24
{txt}       between = {res}0.2705                                        {txt}avg = {res}     24.0
{txt}       overall = {res}0.8586                                        {txt}max = {res}       24

                                                {txt}F({res}28{txt},{res}228{txt})          = {res}  1371.43
{txt}corr(u_i, Xb)  = {res}-0.0163                        {txt}Prob > F           =    {res}0.0000

{txt}{ralign 84:(Std. Err. adjusted for {res:229} clusters in district)}
{hline 19}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 20}{c |}{col 32}    Robust
{col 1}immigration_ment~s{col 20}{c |}      Coef.{col 32}   Std. Err.{col 44}      t{col 52}   P>|t|{col 60}     [95% Con{col 73}f. Interval]
{hline 19}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 8}birth_rate {c |}{col 20}{res}{space 2}-1.674499{col 32}{space 2}  .418936{col 43}{space 1}   -4.00{col 52}{space 3}0.000{col 60}{space 4} -2.49998{col 73}{space 3}-.8490175
{txt}{space 5}foreign_ratio {c |}{col 20}{res}{space 2}-.0601162{col 32}{space 2} .0720198{col 43}{space 1}   -0.83{col 52}{space 3}0.405{col 60}{space 4}-.2020256{col 73}{space 3} .0817932
{txt}{space 1}population_growth {c |}{col 20}{res}{space 2}-.1547288{col 32}{space 2}  .033679{col 43}{space 1}   -4.59{col 52}{space 3}0.000{col 60}{space 4}-.2210908{col 73}{space 3}-.0883669
{txt}{space 7}urban_ratio {c |}{col 20}{res}{space 2} .0018754{col 32}{space 2} .0117342{col 43}{space 1}    0.16{col 52}{space 3}0.873{col 60}{space 4}-.0212458{col 73}{space 3} .0249967
{txt}conservative_ratio {c |}{col 20}{res}{space 2} 1.376761{col 32}{space 2} 1.646989{col 43}{space 1}    0.84{col 52}{space 3}0.404{col 60}{space 4}-1.868504{col 73}{space 3} 4.622026
{txt}{space 18} {c |}
{space 14}year {c |}
{space 13}2001  {c |}{col 20}{res}{space 2} 1.069155{col 32}{space 2} .3832648{col 43}{space 1}    2.79{col 52}{space 3}0.006{col 60}{space 4} .3139609{col 73}{space 3} 1.824349
{txt}{space 13}2002  {c |}{col 20}{res}{space 2} 2.430872{col 32}{space 2}  .390276{col 43}{space 1}    6.23{col 52}{space 3}0.000{col 60}{space 4} 1.661863{col 73}{space 3} 3.199881
{txt}{space 13}2003  {c |}{col 20}{res}{space 2} 3.922863{col 32}{space 2} .4172456{col 43}{space 1}    9.40{col 52}{space 3}0.000{col 60}{space 4} 3.100713{col 73}{space 3} 4.745013
{txt}{space 13}2004  {c |}{col 20}{res}{space 2} 5.626517{col 32}{space 2} .3737752{col 43}{space 1}   15.05{col 52}{space 3}0.000{col 60}{space 4} 4.890022{col 73}{space 3} 6.363013
{txt}{space 13}2005  {c |}{col 20}{res}{space 2} 7.053482{col 32}{space 2} .3871396{col 43}{space 1}   18.22{col 52}{space 3}0.000{col 60}{space 4} 6.290653{col 73}{space 3} 7.816311
{txt}{space 13}2006  {c |}{col 20}{res}{space 2}  7.99643{col 32}{space 2} .4023396{col 43}{space 1}   19.87{col 52}{space 3}0.000{col 60}{space 4} 7.203651{col 73}{space 3} 8.789209
{txt}{space 13}2007  {c |}{col 20}{res}{space 2} 9.501245{col 32}{space 2} .3881729{col 43}{space 1}   24.48{col 52}{space 3}0.000{col 60}{space 4}  8.73638{col 73}{space 3} 10.26611
{txt}{space 13}2008  {c |}{col 20}{res}{space 2} 11.10183{col 32}{space 2} .4114802{col 43}{space 1}   26.98{col 52}{space 3}0.000{col 60}{space 4} 10.29104{col 73}{space 3} 11.91262
{txt}{space 13}2009  {c |}{col 20}{res}{space 2} 12.08356{col 32}{space 2} .3983181{col 43}{space 1}   30.34{col 52}{space 3}0.000{col 60}{space 4}  11.2987{col 73}{space 3} 12.86841
{txt}{space 13}2010  {c |}{col 20}{res}{space 2} 13.16176{col 32}{space 2} .3981823{col 43}{space 1}   33.05{col 52}{space 3}0.000{col 60}{space 4} 12.37717{col 73}{space 3} 13.94634
{txt}{space 13}2011  {c |}{col 20}{res}{space 2} 14.98711{col 32}{space 2} .3831732{col 43}{space 1}   39.11{col 52}{space 3}0.000{col 60}{space 4}  14.2321{col 73}{space 3} 15.74212
{txt}{space 13}2012  {c |}{col 20}{res}{space 2} 16.67745{col 32}{space 2} .3723102{col 43}{space 1}   44.79{col 52}{space 3}0.000{col 60}{space 4} 15.94384{col 73}{space 3} 17.41106
{txt}{space 13}2013  {c |}{col 20}{res}{space 2} 17.82084{col 32}{space 2} .3784989{col 43}{space 1}   47.08{col 52}{space 3}0.000{col 60}{space 4} 17.07504{col 73}{space 3} 18.56665
{txt}{space 13}2014  {c |}{col 20}{res}{space 2} 19.20255{col 32}{space 2} .3861485{col 43}{space 1}   49.73{col 52}{space 3}0.000{col 60}{space 4} 18.44167{col 73}{space 3} 19.96343
{txt}{space 13}2015  {c |}{col 20}{res}{space 2} 20.68439{col 32}{space 2} .4059461{col 43}{space 1}   50.95{col 52}{space 3}0.000{col 60}{space 4} 19.88451{col 73}{space 3} 21.48428
{txt}{space 13}2016  {c |}{col 20}{res}{space 2} 21.71258{col 32}{space 2} .4118618{col 43}{space 1}   52.72{col 52}{space 3}0.000{col 60}{space 4} 20.90104{col 73}{space 3} 22.52412
{txt}{space 13}2017  {c |}{col 20}{res}{space 2} 23.57326{col 32}{space 2} .4044117{col 43}{space 1}   58.29{col 52}{space 3}0.000{col 60}{space 4} 22.77639{col 73}{space 3} 24.37012
{txt}{space 13}2018  {c |}{col 20}{res}{space 2} 24.52654{col 32}{space 2} .4123213{col 43}{space 1}   59.48{col 52}{space 3}0.000{col 60}{space 4}  23.7141{col 73}{space 3} 25.33899
{txt}{space 13}2019  {c |}{col 20}{res}{space 2} 25.91895{col 32}{space 2} .4378523{col 43}{space 1}   59.20{col 52}{space 3}0.000{col 60}{space 4}  25.0562{col 73}{space 3}  26.7817
{txt}{space 13}2020  {c |}{col 20}{res}{space 2}  27.2076{col 32}{space 2} .4270341{col 43}{space 1}   63.71{col 52}{space 3}0.000{col 60}{space 4} 26.36616{col 73}{space 3} 28.04904
{txt}{space 13}2021  {c |}{col 20}{res}{space 2}  27.8145{col 32}{space 2} .4429364{col 43}{space 1}   62.80{col 52}{space 3}0.000{col 60}{space 4} 26.94173{col 73}{space 3} 28.68727
{txt}{space 13}2022  {c |}{col 20}{res}{space 2} 29.04194{col 32}{space 2}  .459597{col 43}{space 1}   63.19{col 52}{space 3}0.000{col 60}{space 4} 28.13634{col 73}{space 3} 29.94754
{txt}{space 13}2023  {c |}{col 20}{res}{space 2}  29.7193{col 32}{space 2} .4888025{col 43}{space 1}   60.80{col 52}{space 3}0.000{col 60}{space 4} 28.75615{col 73}{space 3} 30.68244
{txt}{space 18} {c |}
{space 13}_cons {c |}{col 20}{res}{space 2} 16.51637{col 32}{space 2} 1.413272{col 43}{space 1}   11.69{col 52}{space 3}0.000{col 60}{space 4} 13.73162{col 73}{space 3} 19.30111
{txt}{hline 19}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
           sigma_u {c |} {res} .76031466
           {txt}sigma_e {c |} {res} 3.8696265
               {txt}rho {c |} {res} .03717047{txt}   (fraction of variance due to u_i)
{hline 19}{c BT}{hline 64}

{com}. 
. 
. 
. xtreg sentiment_gap birth_rate foreign_ratio population_growth urban_ratio conservative_ratio i.year, fe cl( district )

{txt}Fixed-effects (within) regression               Number of obs      = {res}     5304
{txt}Group variable: {res}district_1                      {txt}Number of groups   = {res}      229

{txt}R-sq:  within  = {res}0.0046                         {txt}Obs per group: min = {res}       16
{txt}       between = {res}0.0026                                        {txt}avg = {res}     23.2
{txt}       overall = {res}0.0017                                        {txt}max = {res}       24

                                                {txt}F({res}28{txt},{res}228{txt})          = {res}     1.08
{txt}corr(u_i, Xb)  = {res}-0.2105                        {txt}Prob > F           =    {res}0.3684

{txt}{ralign 84:(Std. Err. adjusted for {res:229} clusters in district)}
{hline 19}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 20}{c |}{col 32}    Robust
{col 1}     sentiment_gap{col 20}{c |}      Coef.{col 32}   Std. Err.{col 44}      t{col 52}   P>|t|{col 60}     [95% Con{col 73}f. Interval]
{hline 19}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 8}birth_rate {c |}{col 20}{res}{space 2}-.0090386{col 32}{space 2} .0186298{col 43}{space 1}   -0.49{col 52}{space 3}0.628{col 60}{space 4}-.0457471{col 73}{space 3} .0276699
{txt}{space 5}foreign_ratio {c |}{col 20}{res}{space 2}-.0014509{col 32}{space 2} .0035963{col 43}{space 1}   -0.40{col 52}{space 3}0.687{col 60}{space 4}-.0085371{col 73}{space 3} .0056354
{txt}{space 1}population_growth {c |}{col 20}{res}{space 2}-.0000277{col 32}{space 2} .0013356{col 43}{space 1}   -0.02{col 52}{space 3}0.983{col 60}{space 4}-.0026593{col 73}{space 3} .0026039
{txt}{space 7}urban_ratio {c |}{col 20}{res}{space 2}-.0003039{col 32}{space 2} .0005145{col 43}{space 1}   -0.59{col 52}{space 3}0.555{col 60}{space 4}-.0013177{col 73}{space 3} .0007099
{txt}conservative_ratio {c |}{col 20}{res}{space 2} .0371174{col 32}{space 2} .1051936{col 43}{space 1}    0.35{col 52}{space 3}0.725{col 60}{space 4}-.1701586{col 73}{space 3} .2443933
{txt}{space 18} {c |}
{space 14}year {c |}
{space 13}2001  {c |}{col 20}{res}{space 2} .0012019{col 32}{space 2} .0167524{col 43}{space 1}    0.07{col 52}{space 3}0.943{col 60}{space 4}-.0318074{col 73}{space 3} .0342112
{txt}{space 13}2002  {c |}{col 20}{res}{space 2}-.0030017{col 32}{space 2} .0176698{col 43}{space 1}   -0.17{col 52}{space 3}0.865{col 60}{space 4}-.0378186{col 73}{space 3} .0318153
{txt}{space 13}2003  {c |}{col 20}{res}{space 2} -.025011{col 32}{space 2} .0166954{col 43}{space 1}   -1.50{col 52}{space 3}0.135{col 60}{space 4} -.057908{col 73}{space 3}  .007886
{txt}{space 13}2004  {c |}{col 20}{res}{space 2} .0129196{col 32}{space 2} .0178709{col 43}{space 1}    0.72{col 52}{space 3}0.470{col 60}{space 4}-.0222937{col 73}{space 3} .0481328
{txt}{space 13}2005  {c |}{col 20}{res}{space 2} .0045408{col 32}{space 2} .0187353{col 43}{space 1}    0.24{col 52}{space 3}0.809{col 60}{space 4}-.0323756{col 73}{space 3} .0414573
{txt}{space 13}2006  {c |}{col 20}{res}{space 2}-.0056903{col 32}{space 2}  .015956{col 43}{space 1}   -0.36{col 52}{space 3}0.722{col 60}{space 4}-.0371304{col 73}{space 3} .0257498
{txt}{space 13}2007  {c |}{col 20}{res}{space 2} .0172458{col 32}{space 2} .0175722{col 43}{space 1}    0.98{col 52}{space 3}0.327{col 60}{space 4}-.0173788{col 73}{space 3} .0518705
{txt}{space 13}2008  {c |}{col 20}{res}{space 2} .0277639{col 32}{space 2} .0179362{col 43}{space 1}    1.55{col 52}{space 3}0.123{col 60}{space 4}-.0075781{col 73}{space 3} .0631059
{txt}{space 13}2009  {c |}{col 20}{res}{space 2} .0001728{col 32}{space 2} .0175106{col 43}{space 1}    0.01{col 52}{space 3}0.992{col 60}{space 4}-.0343305{col 73}{space 3}  .034676
{txt}{space 13}2010  {c |}{col 20}{res}{space 2} .0090283{col 32}{space 2} .0178313{col 43}{space 1}    0.51{col 52}{space 3}0.613{col 60}{space 4}-.0261069{col 73}{space 3} .0441635
{txt}{space 13}2011  {c |}{col 20}{res}{space 2}-.0000511{col 32}{space 2} .0167926{col 43}{space 1}   -0.00{col 52}{space 3}0.998{col 60}{space 4}-.0331396{col 73}{space 3} .0330374
{txt}{space 13}2012  {c |}{col 20}{res}{space 2}-.0113769{col 32}{space 2} .0163313{col 43}{space 1}   -0.70{col 52}{space 3}0.487{col 60}{space 4}-.0435564{col 73}{space 3} .0208026
{txt}{space 13}2013  {c |}{col 20}{res}{space 2}-.0055542{col 32}{space 2}  .017188{col 43}{space 1}   -0.32{col 52}{space 3}0.747{col 60}{space 4}-.0394218{col 73}{space 3} .0283134
{txt}{space 13}2014  {c |}{col 20}{res}{space 2}-.0067247{col 32}{space 2}  .017886{col 43}{space 1}   -0.38{col 52}{space 3}0.707{col 60}{space 4}-.0419676{col 73}{space 3} .0285183
{txt}{space 13}2015  {c |}{col 20}{res}{space 2} .0089868{col 32}{space 2}  .018127{col 43}{space 1}    0.50{col 52}{space 3}0.621{col 60}{space 4}-.0267311{col 73}{space 3} .0447048
{txt}{space 13}2016  {c |}{col 20}{res}{space 2} .0208916{col 32}{space 2} .0194721{col 43}{space 1}    1.07{col 52}{space 3}0.284{col 60}{space 4}-.0174767{col 73}{space 3} .0592599
{txt}{space 13}2017  {c |}{col 20}{res}{space 2}-.0099605{col 32}{space 2} .0186332{col 43}{space 1}   -0.53{col 52}{space 3}0.593{col 60}{space 4}-.0466759{col 73}{space 3} .0267548
{txt}{space 13}2018  {c |}{col 20}{res}{space 2}-.0035192{col 32}{space 2} .0183097{col 43}{space 1}   -0.19{col 52}{space 3}0.848{col 60}{space 4} -.039597{col 73}{space 3} .0325586
{txt}{space 13}2019  {c |}{col 20}{res}{space 2}-.0040654{col 32}{space 2} .0204451{col 43}{space 1}   -0.20{col 52}{space 3}0.843{col 60}{space 4}-.0443508{col 73}{space 3}   .03622
{txt}{space 13}2020  {c |}{col 20}{res}{space 2}-.0080411{col 32}{space 2} .0191874{col 43}{space 1}   -0.42{col 52}{space 3}0.676{col 60}{space 4}-.0458484{col 73}{space 3} .0297663
{txt}{space 13}2021  {c |}{col 20}{res}{space 2} .0046885{col 32}{space 2} .0204511{col 43}{space 1}    0.23{col 52}{space 3}0.819{col 60}{space 4}-.0356087{col 73}{space 3} .0449858
{txt}{space 13}2022  {c |}{col 20}{res}{space 2} -.004409{col 32}{space 2} .0213758{col 43}{space 1}   -0.21{col 52}{space 3}0.837{col 60}{space 4}-.0465284{col 73}{space 3} .0377104
{txt}{space 13}2023  {c |}{col 20}{res}{space 2} .0144062{col 32}{space 2} .0220678{col 43}{space 1}    0.65{col 52}{space 3}0.515{col 60}{space 4}-.0290766{col 73}{space 3}  .057889
{txt}{space 18} {c |}
{space 13}_cons {c |}{col 20}{res}{space 2} .2422334{col 32}{space 2} .0788699{col 43}{space 1}    3.07{col 52}{space 3}0.002{col 60}{space 4} .0868264{col 73}{space 3} .3976404
{txt}{hline 19}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
           sigma_u {c |} {res} .04023646
           {txt}sigma_e {c |} {res} .17242815
               {txt}rho {c |} {res} .05164115{txt}   (fraction of variance due to u_i)
{hline 19}{c BT}{hline 64}

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}C:\research\works\주제57_외국인_지방자치\data\STATA_code.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}24 Jul 2025, 11:33:55
{txt}{.-}
{smcl}
{txt}{sf}{ul off}